import * as z from "zod";

const envSchema = z.object({
  NODE_ENV: z.string().default("development"),
  PORT: z.coerce.number().default(9527),

  RPC_API_URL: z.string().default("/api/rpc/v1"),

  /** JWT 配置 */
  JWT_SECRET: z.string().default("XREON"),

  /** 数据库配置 */
  DB_TYPE: z.string().default("mongodb"),
  DB_HOST: z.string().default("127.0.0.1"),
  DB_PORT: z.string().default("27017"),
  DB_NAME: z.string().default("mytest"),
  DB_USERNAME: z.string().default("root"),
  DB_PASSWORD: z.string().default("root"),
});

const env = envSchema.parse(process.env);
export interface IEnv extends z.infer<typeof envSchema> {}

export default env;
